#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QTranslator>
#include "newcharacterdialog.h"
#include "aboutdialog.h"
#include <QDesktopServices>
#include <QUrl>
#include <QStackedWidget>
#include <QProgressBar>
#include <QFileDialog>
#include <QTreeWidget>
#include <customWidgets/editabilityitem.h>
#include <QGridLayout>
#include <deque>
#include <hbdatahandler.h>

namespace Ui {
    class MainWindow;
}


class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

private slots:
    void on_actionNewCharacter_triggered();

    void on_actionExit_triggered();

    void on_actionCharacterMode_triggered();

    void on_actionTraitMode_triggered();

    void on_actionSkillMode_triggered();

    void on_actionEditMode_triggered();

    void on_actionAbout_triggered();

    void on_actionHomepage_triggered();

    void on_statusBar_messageChanged(QString);

    void on_actionLoadCharacter_triggered();

    void on_actionEditMode_AddAbility_triggered();

    void on_typeBox_currentIndexChanged(const QString &arg1);

    void on_editBrowser_currentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous);

private:
    Ui::MainWindow *ui;
    CNewCharacterDialog* pCharSelectDialog;
    CAboutDialog* pAboutDialog;
    QProgressBar* pProgressBar;

    enum EMODE{
        CHARACTERMODE,
        TRAITMODE,
        SKILLMODE,
        EDITMODE
    };
    EMODE activeMode;
    const char* getModeText();
    const char* getModeText(EMODE mode);
    void setStatusBarText(QString,int d=0);
    void setMode(EMODE);



    void initEditPage(void);
    QTreeWidgetItem *skillHeader;
    QTreeWidgetItem *traitHeader;
    QTreeWidgetItem *undefinedHeader;
    //std::vector<CEditAbilityItem> childs;
    std::deque<CEditAbilityItem> childs;
    HBDataHandler* abilityHandler;
};

#endif // MAINWINDOW_H
